package club.xyes.zkh.ecommerce.service.adapter;

import club.xyes.zkh.ecommerce.commons.dto.ConsumptionOverview;
import club.xyes.zkh.ecommerce.commons.entity.Shop;
import club.xyes.zkh.ecommerce.commons.entity.TransactionLog;
import club.xyes.zkh.ecommerce.commons.entity.User;

/**
 * Create by 郭文梁 2019/4/22 0022 09:54
 * TransactionLogSingleDependencyMapperAdapter
 * 交易记录单依赖Mapper适配器
 *
 * @author 郭文梁
 * @data 2019/4/22 0022
 */
public interface TransactionLogSingleDependencyMapperAdapter extends SingleDependencyMapperAdapter<TransactionLog> {
    /**
     * 通过交易号查询交易记录
     *
     * @param tradeNo 交易号
     * @return 交易记录
     */
    TransactionLog findByTradeNo(String tradeNo);

    /**
     * 获取用户在商铺的消费概览
     *
     * @param shop 商铺
     * @param user 用户
     * @return 消费概览
     */
    ConsumptionOverview getConsumptionOverview(Shop shop, User user);
}
